package com.cloudbroker.openapi.mobile.controller;

import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.sign.back.CheckSignBack;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.sign.vo.CheckSignForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.SignT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

/**
 * Created by wangxu13798 on 2016/11/23.
 */
@Controller
public class SignController {
    @Resource
    private SignT2BizService signT2BizService;

    @ResponseBody
    @RequestMapping("/func_check_sign")
    @SaveLog(remark = "校验并加密")
    public CheckSignBack funcCheckSign(HttpServletRequest request , String jsonpcallback){
        CheckSignForm checkSignForm = getSingleParameterMapForBody(request , CheckSignForm.class);
        CheckSignBack checkSignBack = this.signT2BizService.funcCheckSign(checkSignForm);
        return VOUtil.setJsonpResult(checkSignBack, jsonpcallback);
    }
}
